<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="../../assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="../../assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="../../assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="../../assets/css/admin.css">
    <style>
        .guige {
            background-color: #d9d9d9;
            padding: 5px 10px;
            margin: 0 1px;
            text-align: center;
            border-radius: 5px;
        }
    </style>
    <script src="../../js/vue.js"></script>
    <script src="../../js/axios.min.js"></script>
    <script src="../../assets/js/zepto.min.js"></script>
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

<header class="am-topbar admin-header">
    <div class="am-topbar-brand">
        <strong>三泵订货</strong>
        <small>后台管理模板</small>
    </div>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only"
            data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span
            class="am-icon-bars"></span></button>

    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
            <li class="am-dropdown" data-am-dropdown>
                <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;" v-cloak>
                    <span class="am-icon-users"></span> <span id="adminname"></span> <span class="am-icon-caret-down"></span>
                </a>
                <ul class="am-dropdown-content">
                    <li><a href="#" id="tuichu"><span class="am-icon-power-off" ></span> 退出</a></li>
                </ul>
            </li>
            <li><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> 开启全屏</a></li>
        </ul>
    </div>
</header>
<div class="am-cf admin-main">
    <!-- sidebar start -->
    <div class="admin-sidebar" id="daohang">
        <ul class="am-list admin-sidebar-list" id="accordion">
            <li v-if="isShow(27)"><a href="../../管理员.html"><span class="am-icon-user"></span> 管理员设置</a></li>
            <li v-if="isShow(7)"><a href="../../后台主页.html"><span class="am-icon-home"></span> 首页</a></li>
            <li class=" am-panel admin-parent" v-if="isShow(1)">
                <a class="am-cf" data-am-collapse="{parent: '#accordion', target: '#collapse-nav-2'}">
                    <svg id="icon-goods-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M153.6 51.2h716.8c56.32 0 102.4 46.08 102.4 102.4v716.8c0 56.32-46.08 102.4-102.4 102.4H153.6c-56.32 0-102.4-46.08-102.4-102.4V153.6c0-56.32 46.08-102.4 102.4-102.4z" fill="#A1B8C2"></path><path d="M153.6 51.2h716.8c56.32 0 102.4 46.08 102.4 102.4v716.8c0 56.32-46.08 102.4-102.4 102.4H153.6c-56.32 0-102.4-46.08-102.4-102.4V153.6c0-56.32 46.08-102.4 102.4-102.4z m0 51.2c-30.72 0-51.2 20.48-51.2 51.2v716.8c0 30.72 20.48 51.2 51.2 51.2h716.8c30.72 0 51.2-20.48 51.2-51.2V153.6c0-30.72-20.48-51.2-51.2-51.2H153.6z" fill="#6D8994"></path><path d="M353.28 435.2V460.8c0 97.28 71.68 179.2 158.72 179.2s158.72-81.92 158.72-179.2v-25.6c-5.12-10.24-5.12-15.36-5.12-25.6 0-30.72 20.48-51.2 51.2-51.2s51.2 20.48 51.2 51.2-20.48 51.2-51.2 51.2c0 128-92.16 230.4-204.8 230.4s-204.8-102.4-204.8-230.4c-30.72 0-51.2-20.48-51.2-51.2s20.48-51.2 51.2-51.2 51.2 20.48 51.2 51.2c0 10.24 0 15.36-5.12 25.6z" fill="#FFFFFF"></path></svg>
                    商品<span class="am-icon-angle-right am-fr am-margin-right"></span>
                </a>

                <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav-2">
                    <li v-if="isShow(8)"><a href="/html/wares/商品列表.html">商品列表</a></li>
                    <li v-if="isShow(9)"><a href="/html/wares/基础信息.html">基础信息</a></li>
                </ul>
            </li>
            <li class=" am-panel admin-parent" v-if="isShow(2)">
                <a class="am-cf" data-am-collapse="{parent: '#accordion', target: '#collapse-nav-3'}">
                    <svg id="icon-sell-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M414.72 1024H153.6c-56.32 0-102.4-46.08-102.4-102.4V102.4c0-56.32 46.08-102.4 102.4-102.4h261.12c10.24 30.72 40.96 51.2 71.68 51.2s61.44-20.48 71.68-51.2H819.2c56.32 0 102.4 46.08 102.4 102.4v819.2c0 56.32-46.08 102.4-102.4 102.4h-261.12c-10.24-30.72-40.96-51.2-71.68-51.2s-61.44 20.48-71.68 51.2z" fill="#A1B8C2"></path><path d="M153.6 1024c-56.32 0-102.4-46.08-102.4-102.4V102.4c0-56.32 46.08-102.4 102.4-102.4h261.12c10.24 30.72 40.96 51.2 71.68 51.2s61.44-20.48 71.68-51.2H819.2c56.32 0 102.4 46.08 102.4 102.4v819.2c0 56.32-46.08 102.4-102.4 102.4h-261.12c-10.24-30.72-40.96-51.2-71.68-51.2s-61.44 20.48-71.68 51.2H153.6z m332.8-102.4c40.96 0 76.8 20.48 102.4 51.2H819.2c30.72 0 51.2-20.48 51.2-51.2V102.4c0-30.72-20.48-51.2-51.2-51.2h-230.4c-25.6 30.72-61.44 51.2-102.4 51.2s-76.8-20.48-102.4-51.2H153.6c-30.72 0-51.2 20.48-51.2 51.2v819.2c0 30.72 20.48 51.2 51.2 51.2h230.4c25.6-30.72 61.44-51.2 102.4-51.2zM768 51.2h51.2v51.2h-51.2V51.2z m0 870.4h51.2v51.2h-51.2v-51.2z m0-768h51.2v102.4h-51.2V153.6z m0 153.6h51.2v102.4h-51.2V307.2z m0 153.6h51.2v102.4h-51.2V460.8z m0 153.6h51.2v102.4h-51.2v-102.4z m0 153.6h51.2v102.4h-51.2v-102.4zM153.6 51.2h51.2v51.2H153.6V51.2z m0 870.4v51.2h51.2v-51.2H153.6zM153.6 153.6h51.2v102.4H153.6V153.6z m0 153.6h51.2v102.4H153.6V307.2z m0 153.6h51.2v102.4H153.6V460.8z m0 153.6h51.2v102.4H153.6v-102.4z m0 153.6h51.2v102.4H153.6v-102.4z" fill="#6D8994"></path><path d="M337.92 225.28l179.2 179.2c10.24 10.24 10.24 25.6 0 35.84-10.24 10.24-25.6 10.24-35.84 0L302.08 261.12c-10.24-10.24-10.24-25.6 0-35.84 10.24-10.24 25.6-10.24 35.84 0z" fill="#FFFFFF"></path><path d="M455.68 404.48l179.2-179.2c10.24-10.24 25.6-10.24 35.84 0 10.24 10.24 10.24 25.6 0 35.84L491.52 440.32c-10.24 10.24-25.6 10.24-35.84 0-10.24-10.24-10.24-25.6 0-35.84z" fill="#FFFFFF"></path><path d="M332.8 409.6h307.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-307.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6zM332.8 512h307.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-307.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#FFFFFF"></path><path d="M512 409.6v384c0 15.36-10.24 25.6-25.6 25.6s-25.6-10.24-25.6-25.6V409.6h51.2z" fill="#FFFFFF"></path></svg>
                    订单<span class="am-icon-angle-right am-fr am-margin-right"></span>
                </a>

                <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-3">
                    <li class=" am-panel admin-parent" v-if="isShow(10)">
                        <a class="am-cf" data-am-collapse="{parent: '#collapse-nav-3', target: '#collapse-nav-3-1'}">
                            <span>+&nbsp;&nbsp;&nbsp;</span>订单管理</a>
                        <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-3-1">
                            <li><a href="/html/order/订货单.html">订货单</a></li>
                            <li><a href="/html/order/代客下单.html">代客下单</a></li>
                        </ul>
                    </li>

                    <li class=" am-panel admin-parent" v-if="isShow(11)">
                        <a class="am-cf" data-am-collapse="{parent: '#collapse-nav-3', target: '#collapse-nav-3-3'}">
                            <span>+&nbsp;&nbsp;&nbsp;</span>退货管理</a>
                        <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-3-3">
                            <li><a href="/html/order/退货单.html">退货单</a></li>
                            <li><a href="/html/order/新增退货单.html">新增退货单</a></li>
                        </ul>
                    </li>
                </ul>
            </li>
            <li class=" am-panel admin-parent" v-if="isShow(3)">
                <a class="am-cf" data-am-collapse="{parent: '#accordion', target: '#collapse-nav-4'}">
                    <svg id="icon-client-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M609.098914 322.338445l316.72223 185.160688c14.617949 9.745299 24.363248 19.490599 24.363248 34.108548V1024H73.107449V239.503401c0-14.617949 9.745299-34.108548 24.363249-43.853847L462.919424 10.488866c48.726497-24.363248 107.198293-4.87265 131.561541 43.853847 9.745299 14.617949 14.617949 29.235898 14.617949 43.853847v224.141885z" fill="#A1B8C2"></path><path d="M950.184392 975.273503h24.363249c14.617949 0 24.363248 9.745299 24.363248 24.363249s-9.745299 24.363248-24.363248 24.363248H48.744201c-14.617949 0-24.363248-9.745299-24.363249-24.363248s9.745299-24.363248 24.363249-24.363249H73.107449V239.503401c0-14.617949 9.745299-34.108548 24.363249-43.853847L462.919424 10.488866c48.726497-24.363248 107.198293-4.87265 131.561541 43.853847 9.745299 14.617949 14.617949 29.235898 14.617949 43.853847v224.141885l316.72223 185.160688c14.617949 9.745299 24.363248 19.490599 24.363248 34.108548V975.273503zM121.833946 975.273503h438.538472V98.19656c0-9.745299 0-14.617949-4.87265-24.363248-14.617949-19.490599-43.853847-29.235898-68.217096-19.490599L121.833946 239.503401V975.273503z m487.264968 0h292.358982v-428.793172l-292.358982-165.670089V975.273503z" fill="#6D8994"></path><path d="M730.915157 634.188025c14.617949 0 24.363248 9.745299 24.363248 24.363249v97.452993c0 14.617949-9.745299 24.363248-24.363248 24.363249s-24.363248-9.745299-24.363249-24.363249v-97.452993c0-14.617949 9.745299-24.363248 24.363249-24.363249zM341.103182 244.376051c14.617949 0 24.363248 9.745299 24.363248 24.363248v97.452994c0 14.617949-9.745299 24.363248-24.363248 24.363248S316.739933 380.810242 316.739933 366.192293v-97.452994c0-14.617949 9.745299-24.363248 24.363249-24.363248zM341.103182 488.008535c14.617949 0 24.363248 9.745299 24.363248 24.363248v97.452994c0 14.617949-9.745299 24.363248-24.363248 24.363248s-24.363248-9.745299-24.363249-24.363248v-97.452994c0-14.617949 9.745299-24.363248 24.363249-24.363248zM341.103182 731.641019c14.617949 0 24.363248 9.745299 24.363248 24.363248v97.452994c0 14.617949-9.745299 24.363248-24.363248 24.363248s-24.363248-9.745299-24.363249-24.363248v-97.452994c0-14.617949 9.745299-24.363248 24.363249-24.363248z" fill="#FFFFFF"></path></svg>
                    客户<span class="am-icon-angle-right am-fr am-margin-right"></span>
                </a>

                <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-4">
                    <li v-if="isShow(12)"><a href="/html/customer/客户列表.html">客户列表</a></li>
                    <li v-if="isShow(13)"><a href="/html/customer/客户分布.html">客户分布</a></li>
                </ul>
            </li>
            <li class=" am-panel admin-parent" v-if="isShow(4)">
                <a class="am-cf" data-am-collapse="{parent: '#accordion', target: '#collapse-nav-5'}">
                    <svg id="icon-warehouse-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M204.8 1024H102.4c-30.72 0-51.2-20.48-51.2-51.2V486.4C51.2 215.04 256 0 512 0s460.8 215.04 460.8 486.4V972.8c0 30.72-20.48 51.2-51.2 51.2h-102.4c-30.72 0-51.2-20.48-51.2-51.2v-51.2H256v51.2c0 30.72-20.48 51.2-51.2 51.2z" fill="#A1B8C2"></path><path d="M204.8 1024H102.4c-30.72 0-51.2-20.48-51.2-51.2V486.4C51.2 215.04 256 0 512 0s460.8 215.04 460.8 486.4V972.8c0 30.72-20.48 51.2-51.2 51.2h-102.4c-30.72 0-51.2-20.48-51.2-51.2v-51.2H256v51.2c0 30.72-20.48 51.2-51.2 51.2z m0-51.2v-102.4h614.4v102.4h102.4V486.4C921.6 245.76 737.28 51.2 512 51.2S102.4 245.76 102.4 486.4V972.8h102.4z m25.6-204.8h563.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-563.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#6D8994"></path><path d="M230.4 665.6h563.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-563.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6zM230.4 563.2h563.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-563.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#6D8994"></path><path d="M230.4 358.4h204.8c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-204.8c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6zM588.8 358.4h204.8c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-204.8c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#FFFFFF"></path></svg>
                    仓库<span class="am-icon-angle-right am-fr am-margin-right"></span>
                </a>

                <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-5">
                    <li v-if="isShow(14)"><a href="/html/warehouse/商品出库.html">商品出库</a></li>
                    <li v-if="isShow(15)"><a href="/html/warehouse/商品入库.html">商品入库</a></li>
                    <li v-if="isShow(16)"><a href="/html/warehouse/商品库存.html">商品库存</a></li>
                    <li v-if="isShow(17)"><a href="/html/warehouse/库存调拨.html">库存调拨</a></li>
                    <li v-if="isShow(18)"><a href="/html/warehouse/出入库明细.html">出入库明细</a></li>
                </ul>
            </li>
            <li class=" am-panel admin-parent" v-if="isShow(5)">
                <a class="am-cf" data-am-collapse="{parent: '#accordion', target: '#collapse-nav-6'}">
                    <svg id="icon-purchase-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M61.44 307.2h906.24c30.72 0 51.2 20.48 51.2 51.2v10.24l-81.92 522.24c-10.24 51.2-51.2 87.04-102.4 87.04H189.44c-51.2 0-92.16-35.84-102.4-87.04L10.24 368.64C5.12 337.92 25.6 312.32 51.2 307.2h10.24z" fill="#A1B8C2"></path><path d="M61.44 307.2h906.24c30.72 0 51.2 20.48 51.2 51.2v10.24l-81.92 522.24c-10.24 51.2-51.2 87.04-102.4 87.04H189.44c-51.2 0-92.16-35.84-102.4-87.04L10.24 368.64C5.12 337.92 25.6 312.32 51.2 307.2h10.24z m0 51.2l81.92 522.24c5.12 25.6 25.6 40.96 51.2 40.96h645.12c25.6 0 46.08-20.48 51.2-40.96L962.56 358.4H61.44z" fill="#6D8994"></path><path d="M481.28 512v286.72c0 15.36 10.24 25.6 25.6 25.6s25.6-10.24 25.6-25.6V512c0-15.36-10.24-25.6-25.6-25.6s-25.6 10.24-25.6 25.6zM230.4 517.12l30.72 286.72c0 15.36 15.36 25.6 25.6 20.48 15.36 0 25.6-15.36 20.48-25.6l-25.6-291.84c0-15.36-15.36-25.6-25.6-20.48-15.36 0-25.6 15.36-25.6 30.72zM783.36 517.12l-30.72 286.72c0 15.36-15.36 25.6-25.6 20.48-15.36 0-25.6-15.36-20.48-25.6l30.72-286.72c0-15.36 15.36-25.6 25.6-20.48 10.24-5.12 20.48 10.24 20.48 25.6z" fill="#FFFFFF"></path><path d="M358.4 102.4h307.2c20.48 0 35.84 10.24 46.08 30.72L819.2 358.4H204.8l107.52-225.28c10.24-20.48 25.6-30.72 46.08-30.72z m307.2 51.2H358.4L286.72 307.2h450.56L665.6 153.6z" fill="#6D8994"></path></svg>                    采购<span class="am-icon-angle-right am-fr am-margin-right"></span>
                </a>

                <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-6">
                    <li v-if="isShow(19)"><a href="/html/purchase/采购订单.html">采购订单</a></li>
                    <li v-if="isShow(20)"><a href="/html/purchase/采购退货.html">采购退货</a></li>
                    <li v-if="isShow(21)"><a href="/html/purchase/供应商管理.html">供应商管理</a></li>
                </ul>
            </li>
            <li class=" am-panel admin-parent" v-if="isShow(6)">
                <a class="am-cf" data-am-collapse="{parent: '#accordion', target: '#collapse-nav-7'}">
                    <svg id="icon-finance-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M409.827028 204.345943L307.654057 102.172972c0-56.195134 45.977837-102.172972 102.172971-102.172972s102.172972 45.977837 102.172972 102.172972c0-56.195134 45.977837-102.172972 102.172972-102.172972s102.172972 45.977837 102.172971 102.172972l-102.172971 102.172971s357.605401 229.889186 357.6054 505.75621-408.691887 311.627564-408.691886 311.627564c-61.303783 5.108649-137.933512 0-137.933512 0S52.221628 1011.512419 52.221628 704.993504 409.827028 204.345943 409.827028 204.345943z" fill="#A1B8C2"></path><path d="M563.086486 204.345943c0-15.325946 5.108649-25.543243 15.325946-35.76054l81.738377-81.738377c-5.108649-20.434594-25.543243-35.76054-45.977837-35.76054-30.651891 0-51.086486 20.434594-51.086486 51.086486 0 66.412432-102.172972 66.412432-102.172972 0 0-30.651891-20.434594-51.086486-51.086486-51.086486-20.434594 0-40.869189 15.325946-45.977837 30.651891l81.738377 81.738378c10.217297 15.325946 15.325946 25.543243 15.325946 40.869188h102.172972z m35.76054 51.086486H425.152974h-5.108648c-10.217297 10.217297-25.543243 15.325946-35.760541 25.543243-40.869189 25.543243-81.738377 61.303783-117.498917 91.955675-102.172972 102.172972-163.476755 214.56324-163.476755 332.062157 0 112.390269 56.195134 183.911349 158.368106 224.780538 35.76054 15.325946 76.629729 25.543243 117.498918 30.651892 25.543243 5.108649 40.869189 5.108649 56.195134 5.108648H578.412432c10.217297 0 25.543243-5.108649 40.869188-5.108648 45.977837-10.217297 86.847026-20.434594 132.824863-40.869189 112.390269-45.977837 173.694052-117.498917 173.694052-209.454592 0-102.172972-61.303783-214.56324-163.476754-321.844861-35.76054-40.869189-76.629729-71.52108-117.498918-102.172971-20.434594-10.217297-30.651891-20.434594-45.977837-30.651892zM409.827028 204.345943L307.654057 102.172972c0-56.195134 45.977837-102.172972 102.172971-102.172972s102.172972 45.977837 102.172972 102.172972c0-56.195134 45.977837-102.172972 102.172972-102.172972s102.172972 45.977837 102.172971 102.172972l-102.172971 102.172971s357.605401 229.889186 357.6054 505.75621-408.691887 311.627564-408.691886 311.627564c-61.303783 5.108649-137.933512 0-137.933512 0S52.221628 1011.512419 52.221628 704.993504 409.827028 204.345943 409.827028 204.345943z" fill="#6D8994"></path><path d="M501.782703 561.951344h137.933512c15.325946 0 25.543243 10.217297 25.543242 25.543243s-10.217297 25.543243-25.543242 25.543243H512v51.086486h127.716215c15.325946 0 25.543243 10.217297 25.543242 25.543243s-10.217297 25.543243-25.543242 25.543243H512v127.716214c0 15.325946-10.217297 25.543243-25.543243 25.543243s-25.543243-10.217297-25.543243-25.543243V715.210802H333.1973c-15.325946 0-25.543243-10.217297-25.543243-25.543243s10.217297-25.543243 25.543243-25.543243H460.913514v-51.086486H333.1973c-15.325946 0-25.543243-10.217297-25.543243-25.543243s10.217297-25.543243 25.543243-25.543243h137.933511l-102.172971-107.28162c-10.217297-10.217297-10.217297-30.651891-5.108649-40.869189s25.543243-10.217297 35.76054 0l86.847026 91.955675 86.847026-91.955675c10.217297-5.108649 25.543243-5.108649 35.76054 0 5.108649 10.217297 5.108649 30.651891 0 40.869189L501.782703 561.951344z" fill="#FFFFFF"></path></svg>
                    财务<span class="am-icon-angle-right am-fr am-margin-right"></span>
                </a>

                <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-7">
                    <li v-if="isShow(22)"><a href="/html/finance/收款单.html">收款单</a></li>
                    <li v-if="isShow(23)"><a href="/html/finance/付款单.html">付款单</a></li>
                    <li v-if="isShow(24)"><a href="/html/finance/收支流水.html">收支流水</a></li>
                    <li v-if="isShow(25)"><a href="/html/finance/客户对账.html">客户对账</a></li>
                    <li v-if="isShow(26)"><a href="/html/finance/资金账户.html">资金账户</a></li>
                </ul>
            </li>

        </ul>

        <div class="am-panel am-panel-default admin-sidebar-panel">
            <div>
                <p><span class="am-icon-bookmark"></span> 公告</p>
                <p>时光静好，与君语；细水流年，与君同。—— Amaze UI</p>
            </div>
        </div>

        <div class="am-panel am-panel-default admin-sidebar-panel">
            <div>
                <p><span class="am-icon-tag"></span> wiki</p>
                <p>Welcome to the Amaze UI wiki!</p>
            </div>
        </div>
    </div>
    <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content">
      <div class="am-cf am-padding">
          <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">商品</strong> / <small>基础信息</small></div>
      </div>
      <div class="am-tabs" data-am-tabs>
          <ul class="am-tabs-nav am-nav am-nav-tabs">
              <li class="am-active"><a href="#tab1">商品分类</a></li>
              <li><a href="#tab2">商品单位</a></li>
              <li><a href="#tab3">商品标签</a></li>
<!--              <li><a href="#tab4">商品规格</a></li>-->
              <li><a href="#tab5">商品品牌</a></li>
          </ul>

          <div class="am-tabs-bd">
              <div class="am-padding am-tab-panel am-fade am-in am-active" id="tab1">
                  <ul class="am-list-static " style="list-style-type: none">
                      <li v-for="obj in list1" style="vertical-align: middle;background-color: #e9ecf1">
                          <a v-if="obj.childList.length>0" href="#" ><font status="1" style="color: black;font-size: 1.3em" @click="show($event)">+</font></a>
                          <img :src="'http://192.168.2.80:5050/images/tpo/'+obj.log" height="30px" width="30px"/>
                          {{obj.name}}
                          <a :onclick="'Sort.xiugai('+obj.id+')'" href="#"  class="am-fr am-margin-right-sm">编辑</a>
                          <a :onclick="'Sort.delSort('+obj.id+')'" href="#"  class="am-fr am-margin-right-sm">删除</a>
                          <ul v-if="obj.childList.length>0"  class="am-list-static " style="list-style-type: none;display: none">
                              <li v-for="obj1 in obj.childList" style="vertical-align: middle;background-color: #d9d9d9">&nbsp;&nbsp;&nbsp;&nbsp;
                                  <a v-if="obj1.childList.length>0" href="#" ><font status="1" style="color: black;font-size: 1.3em" @click="show($event)">+</font></a>
                                  <img :src="'http://192.168.2.80:5050/images/tpo/'+obj1.log" height="30px" width="30px"/>
                                  {{ obj1.name }}
                                  <a :onclick="'Sort.xiugai('+obj1.id+')'" href="#" class="am-fr am-margin-right-sm">编辑</a>
                                  <a :onclick="'Sort.delSort('+obj1.id+')'" href="#" class="am-fr am-margin-right-sm">删除</a>
                                  <ul v-if="obj1.childList.length>0" class="am-list-static " style="list-style-type: none;display: none">
                                      <li v-for="obj2 in obj1.childList" style="vertical-align: middle;background-color:white">&nbsp;&nbsp;&nbsp;&nbsp;
                                          <img :src="'http://192.168.2.80:5050/images/tpo/'+obj2.log" height="30px" width="30px"/>
                                          {{ obj2.name }}
                                          <a :onclick="'Sort.xiugai('+obj2.id+')'" href="#" class="am-fr am-margin-right-sm">编辑</a>
                                          <a :onclick="'Sort.delSort('+obj2.id+')'" href="#" class="am-fr am-margin-right-sm">删除</a>
                                      </li>
                                  </ul>
                              </li>
                          </ul>
                      </li>
                  </ul>
                  <a href="#" onclick="Sort.addSort()">添加分类</a>
              </div>
              <div class="am-tab-panel am-fade" id="tab2">
                  <ul class="am-list-striped am-list-static">
                      <li v-for="unit in unitList">{{unit.name}}
                          <a href="#" :onclick="'Unit.xiugai('+unit.id+')'" class="am-fr am-margin-right-sm">修改</a>
                          <a href="#" :onclick="'Unit.delUnit('+unit.id+')'" class="am-fr am-margin-right-sm">删除</a>
                      </li>
                  </ul>
                  <a href="#" onclick="Unit.addUnit()" name="danwei">添加单位</a>
              </div>
              <div class="am-tab-panel am-fade" id="tab3">
                  <ul class="am-list-static">
                      <li v-for="la in label_List">
                          <span :class="la.color">{{la.name}}</span>
                          <a href="#" :onclick="'Label.xiugai('+la.id+')'" class="am-fr am-margin-right-sm">修改</a>
                          <a href="#" :onclick="'Label.delLabel('+la.id+')'" class="am-fr am-margin-right-sm">删除</a>
                      </li>
                  </ul>
                  <a href="#" onclick="Label.addLabel()">+添加标签</a>
              </div>
<!--              <div class="am-tab-panel am-fade" id="tab4">-->
<!--                  <ul class="am-list-static am-list-striped" style="list-style-type: none">-->
<!--                      <li style="vertical-align: middle" v-for="specs in specsList">-->
<!--                          <span style="margin: 5px 200px 5px 5px">{{specs.name}}</span>-->
<!--                          <div style="max-width: 1000px;display: inline">-->
<!--                              <span class="guige" v-for="sp in specs.childList">{{sp.name}}</span>-->
<!--                          </div>-->
<!--                          <a href="#" :onclick="'Specs.xiugai('+specs.id+')'" class="am-fr am-margin-right-sm">编辑</a>-->
<!--                          <a href="#" :onclick="'Specs.delSpecs('+specs.id+')'" class="am-fr am-margin-right-sm">删除</a>-->
<!--                      </li>-->
<!--                  </ul>-->
<!--                  <a href="#" onclick="Specs.addSpecs()">添加规格</a>-->
<!--              </div>-->
              <div class="am-tab-panel am-fade" id="tab5">
                  <ul class="am-list-static am-list-striped am-list-border" style="list-style: none">
                      <li v-for="obj in brand_List">
                          <img :src="'http://192.168.2.80:5050/images/tpo/'+obj.log" height="50" width="50"/>{{obj.name}}
                          <a href="#" :onclick="'Brand.xiugai('+obj.id+')'" class="am-fr am-margin-right-sm">编辑</a>
                          <a href="#" :onclick="'Brand.delBrand('+obj.id+')'" class="am-fr am-margin-r ight-sm">删除</a>
                      </li>
                  </ul>
                  <a href="#" :onclick="'Brand.addBrand()'">添加品牌</a>
              </div>
          </div>
      </div>
    </div>

  <!-- content end -->
    <div id="Sort">
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Sort_1">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">{{title}}</div>
                <div class="am-modal-bd">
                    分类名称：
                    <input v-model="name" type="text">
                    <br>
                    分类级别：
                    <select v-model="level"  style="width: 200px" @change="getSortSid()">
                        <option value="0">--请选择分类级别--</option>
                        <option value="1">一级</option>
                        <option value="2">二级</option>
                        <option value="3">三级</option>
                    </select>
                    <br>
                    父级分类：
                    <select style="width: 200px" v-model="sid">
                        <option value="0">--请选择父级分类--</option>
                        <option v-for="sort in sortList"  v-if="sort.id!=id" :value="sort.id">{{sort.name}}</option>
                    </select>
                    <div>
                        添加图片：
                        <input  id="sort-tp-1" type="file" style="display: none">
                        <a href="javascript:sort_tp_1()">
                            <img id="sort-img-1" :src="'http://192.168.2.80:5050/images/tpo/'+log" height="30px" width="30px"/>
                        </a>
                    </div>

                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Sort_2">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">{{title}}</div>
                <div class="am-modal-bd">
                    分类名称：
                    <input v-model="name" type="text">
                    <br>
                    分类级别：
                    <select v-model="level"  style="width: 200px" @change="getSortSid()">
                        <option value="0">--请选择分类级别--</option>
                        <option value="1">一级</option>
                        <option value="2">二级</option>
                        <option value="3">三级</option>
                    </select>
                    <br>
                    父级分类：
                    <select style="width: 200px" v-model="sid">
                        <option value="0">--请选择父级分类--</option>
                        <option v-for="sort in sortList"  v-if="sort.id!=id" :value="sort.id">{{sort.name}}</option>
                    </select>
                    <div>
                        添加图片：
                        <input  id="sort-tp-2" type="file" style="display: none">
                        <a href="javascript:sort_tp_2()">
                            <img id="sort-img-2" :src="'http://192.168.2.80:5050/images/tpo/'+log" height="30px" width="30px"/>
                        </a>
                    </div>

                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="shanchu1">
            <div class="am-modal-dialog">
                <div class="am-modal-hd"></div>
                <div class="am-modal-bd">
                    确认删除？
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
    </div>
    <div id="Unit">
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Unit_1">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">{{title}}</div>
                <div class="am-modal-bd">
                    单位名称：
                    <input type="text" v-model="name">
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Unit_2">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">{{title}}</div>
                <div class="am-modal-bd">
                    单位名称：
                    <input type="text" v-model="name" id="dw">
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="shanchu2">
            <div class="am-modal-dialog">
                <div class="am-modal-hd"></div>
                <div class="am-modal-bd">
                    确认删除？
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
    </div>
    <div id="Label">
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Label_1">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">{{title}}</div>
            <div class="am-modal-bd">
                标签名称：
                <input type="text" v-model="name">
                <div>
                    <input type="radio" name="label_1" v-model="color" value="am-badge am-badge-secondary"><span class="am-badge am-badge-secondary">样式一</span>
                </div>
                <div>
                    <input type="radio" name="label_1" v-model="color" value="am-badge am-badge-primary"><span class="am-badge am-badge-primary">样式二</span>
                </div>
                <div>
                    <input type="radio" name="label_1" v-model="color" value="am-badge am-badge-warning"><span class="am-badge am-badge-warning">样式三</span>
                </div>
                <div>
                    <input type="radio" name="label_1" v-model="color" value="am-badge am-badge-success"><span class="am-badge am-badge-success">样式四</span>
                </div>
                <div>
                    <input type="radio" name="label_1" v-model="color" value="am-badge am-badge-danger"><span class="am-badge am-badge-danger">样式五</span>
                </div>
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                <span class="am-modal-btn" data-am-modal-confirm>确定</span>
            </div>
        </div>
    </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Label_2">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">{{title}}</div>
                <div class="am-modal-bd">
                    标签名称：
                    <input type="text" v-model="name">
                    <div>
                        <input type="radio" name="label_2" v-model="color" value="am-badge am-badge-secondary"><span class="am-badge am-badge-secondary">样式一</span>
                    </div>
                    <div>
                        <input type="radio" name="label_2" v-model="color" value="am-badge am-badge-primary"><span class="am-badge am-badge-primary">样式二</span>
                    </div>
                    <div>
                        <input type="radio" name="label_2" v-model="color" value="am-badge am-badge-warning"><span class="am-badge am-badge-warning">样式三</span>
                    </div>
                    <div>
                        <input type="radio" name="label_2" v-model="color" value="am-badge am-badge-success"><span class="am-badge am-badge-success">样式四</span>
                    </div>
                    <div>
                        <input type="radio" name="label_2" v-model="color" value="am-badge am-badge-danger"><span class="am-badge am-badge-danger">样式五</span>
                    </div>
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="shanchu3">
            <div class="am-modal-dialog">
                <div class="am-modal-hd"></div>
                <div class="am-modal-bd">
                    确认删除？
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
    </div>
<!--    <div id="Specs">-->
<!--        <div class="am-modal am-modal-confirm" tabindex="-1" id="Specs-xg">-->
<!--            <div class="am-modal-dialog">-->
<!--                <div class="am-modal-hd">规格修改</div>-->
<!--                <div class="am-modal-bd">-->
<!--                    规格名称：-->
<!--                    <input type="text" v-model="f_name">-->
<!--                    <div class="am-container am-padding">-->
<!--                        <ul class="am-list">-->
<!--                            <li v-for="sp in spList" style="position: relative">-->
<!--                                {{sp.name}}-->
<!--                                <a href="#" @click="delSp(sp.id)" class="am-close" style="top: -8px;right:1px;position: absolute">&times;</a>-->
<!--                            </li>-->
<!--                        </ul>-->
<!--                    </div>-->
<!--                    <input type="text" v-model="s_name">-->
<!--                    <a href="#" @click="addSp()">添加规格值</a>-->
<!--                </div>-->
<!--                <div class="am-modal-footer">-->
<!--                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>-->
<!--                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="am-modal am-modal-confirm" tabindex="-1" id="Specs-add">-->
<!--            <div class="am-modal-dialog">-->
<!--                <div class="am-modal-hd">添加规格</div>-->
<!--                <div class="am-modal-bd">-->
<!--                    规格名称：-->
<!--                    <input type="text" v-model="f_name">-->
<!--                </div>-->
<!--                <div class="am-modal-footer">-->
<!--                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>-->
<!--                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="am-modal am-modal-confirm" tabindex="-1" id="shanchu4">-->
<!--            <div class="am-modal-dialog">-->
<!--                <div class="am-modal-hd"></div>-->
<!--                <div class="am-modal-bd">-->
<!--                    确认删除？-->
<!--                </div>-->
<!--                <div class="am-modal-footer">-->
<!--                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>-->
<!--                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
<!--    </div>-->
    <div id="Brand">
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Brand_1">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">{{title}}</div>
                <div class="am-modal-bd">
                    品牌名称：
                    <input type="text" v-model="name">
                    <div>
                        添加图片：
                        <input id="brand-tp-1" type="file" style="display: none">
                        <a href="javascript:brand_tp_1()">
                            <img id="brand-img-1" :src="'http://192.168.2.80:5050/images/tpo/'+log" height="30px" width="30px"/>
                        </a>
                    </div>

                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="Brand_2">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">{{title}}</div>
                <div class="am-modal-bd">
                    品牌名称：
                    <input type="text" v-model="name">
                    <div>
                        添加图片：
                        <input id="brand-tp-2" type="file" style="display: none">
                        <a href="javascript:brand_tp_2()">
                            <img id="brand-img-2" :src="'http://192.168.2.80:5050/images/tpo/'+log" height="30px" width="30px"/>
                        </a>
                    </div>

                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
        <div class="am-modal am-modal-confirm" tabindex="-1" id="shanchu5">
            <div class="am-modal-dialog">
                <div class="am-modal-hd"></div>
                <div class="am-modal-bd">
                    确认删除？
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>
    </div>
</div>

<footer>
  <hr>
  <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
</footer>
<script src="../../assets/js/amazeui.min.js"></script>
<script src="../../assets/js/app.js"></script>
<script src="../../js/qiandel.js"></script>
<script>
    function sort_tp_1() {
        $("#sort-tp-1").click()
    }
    function sort_tp_2() {
        $("#sort-tp-2").click()
    }
    function brand_tp_1() {
        $("#brand-tp-1").click()
    }
    function brand_tp_2() {
        $("#brand-tp-2").click()
    }
    var table1=new Vue({
        el:'#tab1',
        data:{
            list1:[],
        },
        methods:{
            show(e){
                if ($(e.currentTarget).attr('status')==1){
                    $(e.target).html("-")
                    $(e.currentTarget).attr('status',0)
                }else {
                    $(e.target).html("+")
                    $(e.currentTarget).attr('status',1)
                }
                $(e.target).parent().siblings("ul").toggle();
                // e.target 是你当前点击的元素
                // e.currentTarget 是你绑定事件的元素
            },
            async get3L(){
                var list=[];
                var response=await axios.post('/wares/getSort3L',{
                    level:1
                });
                var data=response.data;
                list=data.obj
                table1.list1=list;
            }

        },
        mounted(){
            this.get3L()
        }
    })
    var Sort=new Vue({
        el:"#Sort",
        data:{
            title:"添加分类",
            id:1,
            name:'',
            sid:0,
            level:0,
            log:'',
            sortList:[],
            file:null
        },
        methods: {
            async aSort(id){
                Sort.title='编辑分类'
                await axios.post('/wares/getSort',{
                    id:id
                }).then(response=>{
                    var obj=response.data.obj[0];
                    Sort.id=obj.id
                    Sort.name=obj.name
                    Sort.level=obj.level
                    Sort.getSortSid(obj.sid)
                    Sort.log=obj.log
                })
            },
            xiugai(id){
                this.aSort(id)
                $('#Sort_1').modal({
                    relatedElement: this,
                    onConfirm: async function() {//确定
                        var json = {
                            id:Sort.id,
                            name: Sort.name,
                            sid: Sort.sid,
                            level: Sort.level,
                            log: Sort.log
                        }
                        var data = new FormData()
                        data.append('json', JSON.stringify(json))
                        if ($("#sort-tp-1")[0].files[0] != null)
                            data.append("file", $("#sort-tp-1")[0].files[0]);
                        if(Sort.level!=null && Sort.level!=''){
                            if(Sort.name!=null && Sort.name!=''){
                                await axios.post("/wares/updateSort", data, {
                                    'Content-Type': 'multipart/form-data'
                                }).then(response => {
                                    var obj = response.data.obj
                                    if (obj == 1) {

                                        table1.get3L()
                                    } else {
                                        alert("修改失败！")
                                    }
                                })
                            }else{
                                alert("请输入分类名称")
                            }
                        }else{
                            alert("请选择分类级别")
                        }

                    },
                    onCancel: function() {//取消
                    }
                });
            },
            async getSortSid(sid){
                await axios.post('/wares/getSort',{
                    level:Sort.level-1
                }).then(res => {
                    var obj=res.data.obj
                    Sort.sortList=obj
                    if (sid != null) {
                        Sort.sid=sid
                    }else if (obj.length!=0){
                        Sort.sid=obj[0].id
                    }else {
                        Sort.sid=0
                    }
                })
            },
            addSort(){
                Sort.id=null
                Sort.title='添加分类'
                Sort.level=0
                Sort.sid=0
                Sort.name=''
                Sort.log='upload.png'
                $('#Sort_2').modal({
                    relatedElement: this,
                    onConfirm: function() {//确定
                        var json={
                            name:Sort.name,
                            sid:Sort.sid,
                            level:Sort.level,
                            log:Sort.log
                        }
                        var data=new FormData()
                        data.append('json',JSON.stringify(json))
                        data.append("file",$("#sort-tp-2")[0].files[0]);
                        if(Sort.level!=null && Sort.level!=''){
                            if(Sort.name!=null && Sort.name!=''){
                                axios.post("/wares/addSort",data,{
                                    'Content-Type':'multipart/form-data'
                                }).then(response=>{
                                    var obj=response.data.obj
                                    if (obj==1){

                                        table1.get3L()
                                    } else {
                                        alert("添加失败！")
                                    }
                                })
                            }else{
                                alert("分类名称不能为空")
                            }
                        }else{
                            alert("请选择分类级别")
                        }

                    },
                    onCancel: function() {//取消
                    }
                });
            },
            delSort(id){
                this.aSort(id)
                $('#shanchu1').modal({
                    relatedElement: this,
                    onConfirm: function() {
                        axios.post("/wares/delSort",{
                            id:Sort.id,
                            log:Sort.log
                        }).then(res=>{
                            var obj=res.data.obj
                            if (obj==1){
                                
                                table1.get3L()
                            } else {
                                alert("删除失败！")
                            }
                        })
                    },
                    onCancel: function() {
                    }
                });
            }
        },
        mounted(){

        }
    })
    var table2=new Vue({
        el:"#tab2",
        data:{
            unitList:[]
        },
        methods:{
            getUnit(){
                axios.post('/wares/getUnit',{
                }).then(response=>{
                    this.unitList=response.data.obj;
                })
            }
        },
        mounted(){
            this.getUnit()
        }
    })
    var Unit=new Vue({
        el:"#Unit",
        data:{
            title:"添加单位",
            id:null,
            name:''
        },
        methods: {
            aUnit(id){
                Unit.title='编辑单位'
                axios.post('/wares/getUnit',{
                    id:id
                }).then(response=>{
                    var obj=response.data.obj[0];
                    Unit.id=obj.id
                    Unit.name=obj.name
                })
            },
            xiugai(id){
                this.aUnit(id)
                $('#Unit_1').modal({
                    relatedElement: this,
                    onConfirm: async function() {//确定
                        if(Unit.name!=null && Unit.name!=''){
                            axios.post('/wares/updateUnit',{
                                id:Unit.id,
                                name: Unit.name
                            }).then(response => {
                                var obj = response.data.obj
                                if (obj == 1) {
                                    table2.getUnit()
                                } else {
                                    alert("修改失败！")
                                }
                            })
                        }else{
                            alert("单位不能为空")
                        }
                    },
                    onCancel: function() {//取消
                    }
                });
            },
            addUnit(){
                Unit.id=null
                Unit.title='添加单位'
                Unit.name=''
                var dw=$("#dw").val()
                $('#Unit_2').modal({
                    relatedElement: this,
                    onConfirm: async function() {//确定
                        if(Unit.name!=null && Unit.name!=''){
                            axios.post('/wares/addUnit',{
                                name: Unit.name
                            }).then(response => {
                                var obj = response.data.obj
                                if (obj == 1) {
                                    table2.getUnit()
                                } else {
                                    alert("添加失败！")
                                }
                            })
                        }else{
                            alert("单位不能为空")
                        }
                    },
                    onCancel: function() {//取消
                    }
                });
            },
            delUnit(id){
                this.aUnit(id)
                $('#shanchu2').modal({
                    relatedElement: this,
                    onConfirm: function() {
                        axios.post("/wares/delUnit",{
                            id:Unit.id
                        }).then(res=>{
                            var obj=res.data.obj
                            if (obj==1){
                                table2.getUnit()
                            } else {
                                alert("删除失败！")
                            }
                        })
                    },
                    onCancel: function() {
                    }
                });
            }
        },
        mounted(){

        }
    })
    var table3=new Vue({
        el:"#tab3",
        data:{
            label_List:[]
        },
        methods:{
            getLabel(){
                var map={

                }
                axios.post('/wares/getLabel',{

                }).then(response=>{
                    this.label_List=response.data.obj;
                })
            }
        },
        mounted(){
            this.getLabel()
        }
    })
    var Label=new Vue({
        el:"#Label",
        data:{
            title:"添加标签",
            id:null,
            name:'',
            color:''
        },
        methods: {
            async aLabel(id){
                Label.title='修改标签'
                await axios.post('/wares/getLabel',{
                    id:id
                }).then(response=>{
                    var obj=response.data.obj[0];
                    Label.id=obj.id
                    Label.name=obj.name
                    Label.color=obj.color
                })
            },
            xiugai(id){
                Label.aLabel(id)
                $('#Label_1').modal({
                    // relatedElement: this,
                    onConfirm:function() {//确定
                       if(id!=null && id!=''){
                           axios.post('/wares/updateLabel',{
                               id:Label.id,
                               name: Label.name,
                               color:Label.color
                           }).then(response => {
                               var obj = response.data.obj
                               if (obj == 1) {

                                   table3.getLabel()
                               } else {
                                   alert("修改失败！")
                               }
                           })
                       }else{
                           alert("请选择标签")
                       }
                    },
                    onCancel: function() {//取消
                    }
                });
            },
            addLabel(){
                Label.id=null
                Label.title='添加标签'
                Label.name=''
                Label.color='am-badge am-badge-secondary'
                $('#Label_2').modal({
                    // relatedElement: this,
                    onConfirm:function() {//确定
                        axios.post('/wares/addLabel',{
                            name: Label.name,
                            color:Label.color
                        }).then(response => {
                            var obj = response.data.obj
                            if (obj == 1) {

                                table3.getLabel()
                            } else {
                                alert("添加失败！")
                            }
                        })
                    },
                    onCancel: function() {//取消
                    }
                });
            },
            delLabel(id){
                this.aLabel(id)
                $('#shanchu3').modal({
                    relatedElement: this,
                    onConfirm: async function() {
                        await axios.post("/wares/delLabel",{
                            id:Label.id
                        }).then(res=>{
                            var obj=res.data.obj
                            if (obj==1){
                                
                                table3.getLabel()
                            } else {
                                alert("删除失败！")
                            }
                        })
                    },
                    onCancel: function() {
                    }
                });
            }
        },
        mounted(){

        }
    })
    var table4=new Vue({
        el:'#tab4',
        data:{
            name:'',
            specsList:[],
        },
        methods:{
            async getallSpecs(){
                var list=[];
                var response=await axios.post('/wares/getallSpecs',{
                    level:1
                });
                var data=response.data;
                list=data.obj
                table4.specsList=list;
            }

        },
        mounted(){
            this.getallSpecs()
        }
    })
    var Specs=new Vue({
        el:"#Specs",
        data:{
            id:null,
            spId:null,
            f_name:'',
            s_name:'',
            spList:[]
        },
        methods: {
            aSpecs(id){
                axios.post('/wares/getallSpecs',{
                    id:id
                }).then(response=>{
                    var obj=response.data.obj[0];
                    Specs.id=obj.id
                    Specs.f_name=obj.name
                    Specs.spId=obj.spId
                    Specs.spList=obj.childList
                })
            },
            xiugai(id){
                Specs.s_name=''
                this.aSpecs(id)
                $('#Specs-xg').modal({
                    relatedElement: this,
                    onConfirm: async function() {//确定
                        axios.post('/wares/updateSpecs',{
                            id:Specs.id,
                            spId:0,
                            level:1,
                            name: Specs.f_name
                        }).then(response => {
                            var obj = response.data.obj
                            if (obj == 1) {
                                table4.getallSpecs()
                            } else {
                                alert("修改失败！")
                            }
                        })
                    },
                    onCancel: function() {//取消
                    }
                });
            },
            addSpecs(){
                Specs.f_name=''
                $('#Specs-add').modal({
                    relatedElement: this,
                    onConfirm: async function() {//确定
                        axios.post('/wares/addSpecs',{
                            spId:0,
                            name: Specs.f_name,
                            level:1
                        }).then(response => {
                            var obj = response.data.obj
                            if (obj == 1) {
                                table4.getallSpecs()
                            } else {
                                alert("添加失败！")
                            }
                        })
                    },
                    onCancel: function() {//取消
                    }
                });
            },
            addSp(){
                axios.post('/wares/addSpecs',{
                    spId:Specs.id,
                    name: Specs.s_name,
                    level:2
                }).then(response => {
                    var obj = response.data.obj
                    if (obj == 1) {
                        Specs.aSpecs(Specs.id)
                        table4.getallSpecs()
                        Specs.s_name=''
                    } else {
                        alert("添加失败！")
                    }
                })
            },
            delSpecs(id){
                this.aSpecs(id)
                $('#shanchu4').modal({
                    relatedElement: this,
                    onConfirm: function() {
                        axios.post("/wares/delSpecs",{
                            id:id
                        }).then(res=>{
                            var obj=res.data.obj
                            if (obj==1){
                                table4.getallSpecs()
                            } else {
                                alert("删除失败！")
                            }
                        })
                    },
                    onCancel: function() {
                    }
                });
            },
            delSp(id){
                axios.post("/wares/delSpecs",{
                    id:id
                }).then(res=>{
                    var obj=res.data.obj
                    if (obj==1){
                        this.aSpecs(Specs.id)
                        table4.getallSpecs()
                    } else {
                        alert("删除失败！")
                    }
                })
            }
        },
        mounted(){

        }
    })

    var table5=new Vue({
        el:"#tab5",
        data:{
            brand_List:[]
        },
        methods:{
            getBrand(){
                var map={

                }
                axios.post('/wares/getBrand',{

                }).then(response=>{
                    this.brand_List=response.data.obj;
                })
            }
        },
        mounted(){
            this.getBrand()
        }
    })
    var Brand=new Vue({
        el:"#Brand",
        data:{
            title:"添加品牌",
            id:null,
            name:'',
            log:'upload.png'
        },
        methods: {
            aBrand(id){
                Brand.title='编辑品牌'
                axios.post('/wares/getBrand',{
                    id:id
                }).then(response=>{
                    var obj=response.data.obj[0];
                    Brand.id=obj.id
                    Brand.name=obj.name
                    Brand.log=obj.log
                })
            },
            xiugai(id){
                Brand.aBrand(id)
                $('#Brand_1').modal({
                    relatedElement: this,
                    onConfirm: async function() {//确定
                        var json = {
                            id:Brand.id,
                            name: Brand.name,
                            log: Brand.log
                        }
                        var data = new FormData()
                        data.append('json', JSON.stringify(json))
                        if ($("#brand-tp-1")[0].files[0] != null)
                            data.append("file", $("#brand-tp-1")[0].files[0]);
                        if(Brand.name!=null && Brand.name!=''){
                            await axios.post("/wares/updateBrand", data, {
                                'Content-Type': 'multipart/form-data'
                            }).then(response => {
                                var obj = response.data.obj
                                if (obj == 1) {
                                    table5.getBrand()
                                } else {
                                    alert("修改失败！")
                                }
                            })
                        }else{
                            alert("品牌名称不能为空")
                        }
                    },
                    onCancel: function() {//取消
                    }
                });
            },
            addBrand(){
                Brand.id=null
                Brand.title='添加品牌'
                Brand.name=''
                Brand.log='upload.png'
                $('#Brand_2').modal({
                    relatedElement: this,
                    onConfirm: async function() {//确定
                        var json={
                            name:Brand.name
                        }
                        var data=new FormData()
                        data.append('json',JSON.stringify(json))
                        data.append("file",$("#brand-tp-2")[0].files[0]);
                        if(Brand.name!=null && Brand.name!=''){
                            axios.post("/wares/addBrand",data,{
                                'Content-Type':'multipart/form-data'
                            }).then(response=>{
                                var obj=response.data.obj
                                if (obj==1){
                                    table5.getBrand()
                                } else {
                                    alert("添加失败！")
                                }
                            })
                        }else{
                            alert("品牌名称不能为空")
                        }

                    },
                    onCancel: function() {//取消
                    }
                });
            },
            delBrand(id){
                this.aBrand(id)
                $('#shanchu5').modal({
                    relatedElement: this,
                    onConfirm: function() {
                        axios.post("/wares/delBrand",{
                            id:Brand.id
                        }).then(res=>{
                            var obj=res.data.obj
                            if (obj==1){
                                table5.getBrand()
                            } else {
                                alert("删除失败！")
                            }
                        })
                    },
                    onCancel: function() {
                    }
                });
            }
        },
        mounted(){

        }
    })

    $(function() {

        $("#sort-tp-1").change(function () {
            $("#sort-img-1").attr("src",URL.createObjectURL(this.files[0]));
        })
        $("#sort-tp-2").change(function () {
            $("#sort-img-2").attr("src",URL.createObjectURL(this.files[0]));
        })
        $("#brand-tp-1").change(function () {
            $("#brand-img-1").attr("src",URL.createObjectURL(this.files[0]));
        })
        $("#brand-tp-2").change(function () {
            $("#brand-img-2").attr("src",URL.createObjectURL(this.files[0]));
        })
    });
</script>

</body>
</html>
